
const blogItemModel = require("../model/blogItemModel/blog_item")


const articleService = {
    // 操作添加博客
    addArticle: (contentId, title, contentHtml, createTimer, articleClassVal, CoverImageurl, author, articleTagValue, articledescribe) => {
        return blogItemModel.addblogItem(contentId, title, contentHtml, createTimer, articleClassVal, CoverImageurl, author, articleTagValue, articledescribe)
    },

    // 请求网站的名称和底部等
    getmainmesage: () => {
        return blogItemModel.getmainmesage()
    },

    // 请求数据库所有数据
    articleItem: (page) => {
        return blogItemModel.getblogItem(page);
    },

    // 请求返回所有博客的长度
    blogitemlength: () => {
        return blogItemModel.getblogitemnum();
    },

    // 访问页面对应返回数据
    articleItemContent: (id) => {
        return blogItemModel.getblogItemContent(id)
    },

    // 发送评论
    sendComment: (commentId, contentId, userName, userImg, userEmail, leaveWord, createTimer) => {
        return blogItemModel.sendComment(commentId, contentId, userName, userImg, userEmail, leaveWord, createTimer)
    },

    // 请求评论
    getcomment: (contentId) => {
        return blogItemModel.getcomment(contentId)
    },

    // 回复评论
    replycomment:(replyCommentId, commentId, userName, userImg, userEmail, replyWord, createTimer)=>{
        return blogItemModel.replycomment(replyCommentId, commentId, userName, userImg, userEmail, replyWord, createTimer)
    },

    // 请求当前评论的所有回复
    searchreplylist:(commentID)=>{
        return blogItemModel.searchreplylist(commentID)
    },

    // 根据分类请求文章
    selectclass: (className) => {
        return blogItemModel.selectclass(className)
    },
    // 添加留言
    sendmessageboard: (id, messageText, createTimer) => {
        return blogItemModel.sendmessageboard(id, messageText, createTimer)
    },
    // 请求所有留言
    getmessageboard: () => {
        return blogItemModel.getmessageboard()
    },
}

module.exports = articleService